#ifndef SHADER_H
#define SHADER_H

#include <gl/glew.h>

#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <glm/glm.hpp>

class MyShader
{
public:
	unsigned int ID;
	// constructor generates the shader on the fly
	MyShader();
	// ------------------------------------------------------------------------
	void loadyShader(const GLchar* vertexPath, const GLchar* fragmentPath);
	// activate the shader
	// ------------------------------------------------------------------------
	void use();
	// utility uniform functions
	// ------------------------------------------------------------------------
	void setBool(const std::string& name, bool value);
	// ------------------------------------------------------------------------
	void setInt(const std::string& name, int value) const
	{
		glUniform1i(glGetUniformLocation(ID, name.c_str()), value);
	}
	// ------------------------------------------------------------------------
	void setFloat(const std::string& name, float value) const
	{
		glUniform1f(glGetUniformLocation(ID, name.c_str()), value);
	}

    void setMat4(const std::string &name, const glm::mat4 &mat);
};
#endif

